package com.lagou.controller;

import com.lagou.commom.pojo.Products;
import com.lagou.feign.ProductFeign;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
@RequestMapping("/page")
public class PageController {
    @Autowired
    private ProductFeign productFeign;

    @RequestMapping("/getData/{id}")
    public Products getData(@PathVariable("id") Integer id) {
        return productFeign.getProduct(id);
    }

    @GetMapping("/getLancePort")
    public String getLancePort() {
      return productFeign.getPort();
    }












}
